<?php

/**
 * Faett_Package
 *
 * NOTICE OF LICENSE
 * 
 * Faett_Package is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Faett_Package is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Faett_Package.  If not, see <http://www.gnu.org/licenses/>.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Faett_Package to newer
 * versions in the future. If you wish to customize Faett_Package for your
 * needs please refer to http://www.faett.net for more information.
 *
 * @category   Faett
 * @package    Faett_Package
 * @copyright  Copyright (c) 2009 <tw@faett.net> Tim Wagner
 * @license    <http://www.gnu.org/licenses/> 
 * 			   GNU General Public License (GPL 3)
 */

?>
<?php
/**
 * @see Mage_Package_Block_Customer_Products_List
 */
?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $_items = $this->getItems(); ?>
<div class="page-head">
    <h3><?php echo Mage::helper('package')->__('My Package Products') ?></h3>
</div>
<?php echo $this->getChildHtml('pager'); ?>
<?php if(count($_items)): ?>
<table cellspacing="0" class="data-table" id="my-package-products-table">
    <thead>
        <tr>
            <th><?php echo Mage::helper('package')->__('Product') ?></th>
            <th><?php echo Mage::helper('package')->__('Date') ?></th>
            <th><?php echo Mage::helper('package')->__('Order #') ?></th>
            <th><?php echo Mage::helper('package')->__('Action') ?></th>
        </tr>
    </thead>
    <tbody>
        <?php $_odd = ''; ?>
        <?php foreach ($_items as $_item): ?>
        	<tr>
        		<td>
        		    <?php echo $_item->getProductName() ?><br/>
        		    <div><?php echo $this->__('Licence number') ?>:<br/><em><?php echo $_item->getSerialz() ?></em></div>
        		</td>
        		</td>
        		<td><?php echo $this->formatDate($_item->getCreatedAt()) ?></td>
        		<td><a href="<?php echo $this->getOrderViewUrl($_item->getOrderId()) ?>" title="<?php echo Mage::helper('package')->__('View Order') ?>"><?php echo $_item->getOrderIncrementId() ?></a></td>
        		<td><a href="<?php echo $this->getDownloadUrl($_item) ?>" title="<?php echo Mage::helper('package')->__('Download Package') ?>"><em><?php echo ucfirst($_item->getState()) ?></em></a></td>
        	</tr>
        <?php endforeach; ?>
    </tbody>
</table>
<script type="text/javascript">decorateTable('my-package-products-table')</script>
<?php else: ?>
    <p><?php echo Mage::helper('package')->__('You have not purchased any package products yet.'); ?></p>
<?php endif; ?>
<?php echo $this->getChildHtml('pager'); ?>
<div class="button-set">
    <a href="<?php echo $this->getBackUrl() ?>" class="left">&laquo; <?php echo $this->__('Back') ?></a>
</div>